<template>
	<view class="confirm" v-show="confirmView">
		<view class="Mask" @click="colse">

		</view>
		<form @submit="formSubmit" class="pop centered">
			<view class="title">
				文字确认
			</view>
			<view class="subtitle">
				本人已详细阅读知悉责任状所有内容，承诺遵守并执行
			</view>
			<input class="inp" name="inp" type="text" @confirm="inpSubmit" confirm-type="确定" placeholder="请输入上方文字"
				placeholder-class="placeholder" />
			<button class="btn" form-type="submit">
				提交并签字确认
			</button>
			<!-- <uni-link v-show="item.template_id!=6" :href="href" :text="href" showUnderLine="false" color="red">
				<view class="btn" >
					提交并签字确认
				</view>
			</uni-link> -->
		</form>
	</view>
</template>

<script>
	export default {
		name: "confirm",
		data() {
			return {
				confirmView: false,
			};
		},
		props: {
			href: ""
		},
		methods: {
			open() {
				this.confirmView = true;
			},
			colse() {
				this.confirmView = false;
			},
			inpSubmit(e) {
				console.log(e.detail.value)
				// this.colse()
			},
			formSubmit(e) {
				if (e.detail.value.inp != '本人已详细阅读知悉责任状所有内容，承诺遵守并执行' && e.detail.value.inp != "本人已详细阅读知悉责任状所有内容,承诺遵守并执行" &&
					e.detail.value.inp != "本人已详细阅读知悉责任状所有内容承诺遵守并执行") {
					uni.showToast({
						icon: "none",
						title: '请输入上方文字'
					})
					return
				}
				setTimeout(() => {
					window.location.href = this.href
				})
				this.colse()
			}
		}
	}
</script>

<style lang="less">
	@import url("../../index.less");
	.confirm {
		width: 100vw;
		height: 100vh;
		//
		position: fixed;
		z-index: 110;
		top: 0;
		left: 0;

		.Mask {
			width: 100%;
			height: 100%;
			background: rgba(0, 0, 0, 0.31);
		}

		.pop {
			width: 580rpx;
			height: 400rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			color: #000000;

			.title {
				font-size: @font15;
				font-weight: bold;
				text-align: center;
				margin: 40rpx auto;

			}

			.subtitle {
				font-size: @font14;
				font-weight: 400;
				width: 520rpx;
				height: 69rpx;
				margin: 0 auto;
			}

			.inp {
				width: 520rpx;
				font-size: @font12;
				font-weight: 400;
				color: #999999;
				margin: 40rpx auto;
				padding: 0 0 20rpx;
				border: none;
				border-bottom: 1rpx solid #707070;
			}

			.placeholder {
				font-size: @font12;
				font-weight: 400;
				color: #999999;
				padding: 0;
			}

			.btn {
				width: 420rpx;
				height: 60rpx;
				background: #FF7100;
				border-radius: 30rpx;
				font-size: @font14;
				text-align: center;
				font-weight: 400;
				color: #FFFFFF;
				margin: 0 auto;
				line-height: 60rpx;
			}
		}
	}
</style>